Integrand size = 26, antiderivative size = 91 \[ \int \sec (c+d x) (a \cos (c+d x)+b \sin (c+d x))^3 \, dx=\frac {1}{2} a \left (a^2+3 b^2\right ) x-\frac {b^3 \log (\sin (c+d x))}{d}+\frac {b^3 \log (\tan (c+d x))}{d}+\frac {\left (b \left (3 a^2-b^2\right )+a \left (a^2-3 b^2\right ) \cot (c+d x)\right ) \sin ^2(c+d x)}{2 d} \]
[Out]
Time = 0.15 (sec) , antiderivative size = 91, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.231, Rules used = {3167, 1819, 815, 649, 209, 266} \[ \int \sec (c+d x) (a \cos (c+d x)+b \sin (c+d x))^3 \, dx=\frac {\sin ^2(c+d x) \left (a \left (a^2-3 b^2\right ) \cot (c+d x)+b \left (3 a^2-b^2\right )\right )}{2 d}+\frac {1}{2} a x \left (a^2+3 b^2\right )-\frac {b^3 \log (\sin (c+d x))}{d}+\frac {b^3 \log (\tan (c+d x))}{d} \]
[In]
[Out]
Rule 209
Rule 266
Rule 649
Rule 815
Rule 1819
Rule 3167
Rubi steps \begin{align*} \text {integral}& = -\frac {\text {Subst}\left (\int \frac {(b+a x)^3}{x \left (1+x^2\right )^2} \, dx,x,\cot (c+d x)\right )}{d} \\ & = \frac {\left (b \left (3 a^2-b^2\right )+a \left (a^2-3 b^2\right ) \cot (c+d x)\right ) \sin ^2(c+d x)}{2 d}+\frac {\text {Subst}\left (\int \frac {-2 b^3-a \left (a^2+3 b^2\right ) x}{x \left (1+x^2\right )} \, dx,x,\cot (c+d x)\right )}{2 d} \\ & = \frac {\left (b \left (3 a^2-b^2\right )+a \left (a^2-3 b^2\right ) \cot (c+d x)\right ) \sin ^2(c+d x)}{2 d}+\frac {\text {Subst}\left (\int \left (-\frac {2 b^3}{x}+\frac {-a^3-3 a b^2+2 b^3 x}{1+x^2}\right ) \, dx,x,\cot (c+d x)\right )}{2 d} \\ & = \frac {b^3 \log (\tan (c+d x))}{d}+\frac {\left (b \left (3 a^2-b^2\right )+a \left (a^2-3 b^2\right ) \cot (c+d x)\right ) \sin ^2(c+d x)}{2 d}+\frac {\text {Subst}\left (\int \frac {-a^3-3 a b^2+2 b^3 x}{1+x^2} \, dx,x,\cot (c+d x)\right )}{2 d} \\ & = \frac {b^3 \log (\tan (c+d x))}{d}+\frac {\left (b \left (3 a^2-b^2\right )+a \left (a^2-3 b^2\right ) \cot (c+d x)\right ) \sin ^2(c+d x)}{2 d}+\frac {b^3 \text {Subst}\left (\int \frac {x}{1+x^2} \, dx,x,\cot (c+d x)\right )}{d}-\frac {\left (a \left (a^2+3 b^2\right )\right ) \text {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\cot (c+d x)\right )}{2 d} \\ & = \frac {1}{2} a \left (a^2+3 b^2\right ) x-\frac {b^3 \log (\sin (c+d x))}{d}+\frac {b^3 \log (\tan (c+d x))}{d}+\frac {\left (b \left (3 a^2-b^2\right )+a \left (a^2-3 b^2\right ) \cot (c+d x)\right ) \sin ^2(c+d x)}{2 d} \\ \end{align*}
Leaf count is larger than twice the leaf count of optimal. \(401\) vs. \(2(91)=182\).
Time = 0.63 (sec) , antiderivative size = 401, normalized size of antiderivative = 4.41 \[ \int \sec (c+d x) (a \cos (c+d x)+b \sin (c+d x))^3 \, dx=\frac {5 a^4 b^2+2 a^2 b^4-b^6+\left (-3 a^4 b^2-2 a^2 b^4+b^6\right ) \cos (2 (c+d x))+2 a^2 b^4 \log \left (\sqrt {-b^2}-b \tan (c+d x)\right )+2 b^6 \log \left (\sqrt {-b^2}-b \tan (c+d x)\right )-a^5 \sqrt {-b^2} \log \left (\sqrt {-b^2}-b \tan (c+d x)\right )+4 a^3 \left (-b^2\right )^{3/2} \log \left (\sqrt {-b^2}-b \tan (c+d x)\right )-3 a \left (-b^2\right )^{5/2} \log \left (\sqrt {-b^2}-b \tan (c+d x)\right )+2 a^2 b^4 \log \left (\sqrt {-b^2}+b \tan (c+d x)\right )+2 b^6 \log \left (\sqrt {-b^2}+b \tan (c+d x)\right )+a^5 \sqrt {-b^2} \log \left (\sqrt {-b^2}+b \tan (c+d x)\right )+3 a b^4 \sqrt {-b^2} \log \left (\sqrt {-b^2}+b \tan (c+d x)\right )-4 a^3 \left (-b^2\right )^{3/2} \log \left (\sqrt {-b^2}+b \tan (c+d x)\right )+a b \left (a^4-2 a^2 b^2-3 b^4\right ) \sin (2 (c+d x))}{4 b \left (a^2+b^2\right ) d} \]
[In]
[Out]
Time = 0.97 (sec) , antiderivative size = 98, normalized size of antiderivative = 1.08
method | result | size |
derivativedivides | \(\frac {a^{3} \left (\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )-\frac {3 \cos \left (d x +c \right )^{2} a^{2} b}{2}+3 a \,b^{2} \left (-\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+b^{3} \left (-\frac {\sin \left (d x +c \right )^{2}}{2}-\ln \left (\cos \left (d x +c \right )\right )\right )}{d}\) | \(98\) |
default | \(\frac {a^{3} \left (\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )-\frac {3 \cos \left (d x +c \right )^{2} a^{2} b}{2}+3 a \,b^{2} \left (-\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+b^{3} \left (-\frac {\sin \left (d x +c \right )^{2}}{2}-\ln \left (\cos \left (d x +c \right )\right )\right )}{d}\) | \(98\) |
parts | \(\frac {a^{3} \left (\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )}{d}+\frac {b^{3} \left (-\frac {\sin \left (d x +c \right )^{2}}{2}-\ln \left (\cos \left (d x +c \right )\right )\right )}{d}-\frac {3 a^{2} b}{2 d \sec \left (d x +c \right )^{2}}+\frac {3 a \,b^{2} \left (-\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )}{d}\) | \(106\) |
parallelrisch | \(\frac {4 b^{3} \ln \left (\sec \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )-4 b^{3} \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )-4 b^{3} \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )+\left (-3 a^{2} b +b^{3}\right ) \cos \left (2 d x +2 c \right )+\left (a^{3}-3 a \,b^{2}\right ) \sin \left (2 d x +2 c \right )+2 a^{3} x d +6 a \,b^{2} d x +3 a^{2} b -b^{3}}{4 d}\) | \(124\) |
risch | \(i x \,b^{3}+\frac {a^{3} x}{2}+\frac {3 a \,b^{2} x}{2}-\frac {3 \,{\mathrm e}^{2 i \left (d x +c \right )} a^{2} b}{8 d}+\frac {{\mathrm e}^{2 i \left (d x +c \right )} b^{3}}{8 d}-\frac {i {\mathrm e}^{2 i \left (d x +c \right )} a^{3}}{8 d}+\frac {3 i {\mathrm e}^{2 i \left (d x +c \right )} a \,b^{2}}{8 d}-\frac {3 \,{\mathrm e}^{-2 i \left (d x +c \right )} a^{2} b}{8 d}+\frac {{\mathrm e}^{-2 i \left (d x +c \right )} b^{3}}{8 d}+\frac {i {\mathrm e}^{-2 i \left (d x +c \right )} a^{3}}{8 d}-\frac {3 i {\mathrm e}^{-2 i \left (d x +c \right )} a \,b^{2}}{8 d}+\frac {2 i b^{3} c}{d}-\frac {b^{3} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}{d}\) | \(196\) |
norman | \(\frac {\left (\frac {1}{2} a^{3}+\frac {3}{2} a \,b^{2}\right ) x +\left (\frac {1}{2} a^{3}+\frac {3}{2} a \,b^{2}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6}+\left (\frac {3}{2} a^{3}+\frac {9}{2} a \,b^{2}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+\left (\frac {3}{2} a^{3}+\frac {9}{2} a \,b^{2}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}+\frac {\left (6 a^{2} b -2 b^{3}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}{d}+\frac {\left (6 a^{2} b -2 b^{3}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}}{d}+\frac {a \left (a^{2}-3 b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}-\frac {a \left (a^{2}-3 b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{d}}{\left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )^{3}}+\frac {b^{3} \ln \left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )}{d}-\frac {b^{3} \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{d}-\frac {b^{3} \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{d}\) | \(272\) |
[In]
[Out]
none
Time = 0.25 (sec) , antiderivative size = 79, normalized size of antiderivative = 0.87 \[ \int \sec (c+d x) (a \cos (c+d x)+b \sin (c+d x))^3 \, dx=-\frac {2 \, b^{3} \log \left (-\cos \left (d x + c\right )\right ) - {\left (a^{3} + 3 \, a b^{2}\right )} d x + {\left (3 \, a^{2} b - b^{3}\right )} \cos \left (d x + c\right )^{2} - {\left (a^{3} - 3 \, a b^{2}\right )} \cos \left (d x + c\right ) \sin \left (d x + c\right )}{2 \, d} \]
[In]
[Out]
\[ \int \sec (c+d x) (a \cos (c+d x)+b \sin (c+d x))^3 \, dx=\int \left (a \cos {\left (c + d x \right )} + b \sin {\left (c + d x \right )}\right )^{3} \sec {\left (c + d x \right )}\, dx \]
[In]
[Out]
none
Time = 0.26 (sec) , antiderivative size = 91, normalized size of antiderivative = 1.00 \[ \int \sec (c+d x) (a \cos (c+d x)+b \sin (c+d x))^3 \, dx=\frac {6 \, a^{2} b \sin \left (d x + c\right )^{2} + {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} a^{3} + 3 \, {\left (2 \, d x + 2 \, c - \sin \left (2 \, d x + 2 \, c\right )\right )} a b^{2} - 2 \, {\left (\sin \left (d x + c\right )^{2} + \log \left (\sin \left (d x + c\right )^{2} - 1\right )\right )} b^{3}}{4 \, d} \]
[In]
[Out]
none
Time = 0.35 (sec) , antiderivative size = 93, normalized size of antiderivative = 1.02 \[ \int \sec (c+d x) (a \cos (c+d x)+b \sin (c+d x))^3 \, dx=\frac {b^{3} \log \left (\tan \left (d x + c\right )^{2} + 1\right ) + {\left (a^{3} + 3 \, a b^{2}\right )} {\left (d x + c\right )} - \frac {b^{3} \tan \left (d x + c\right )^{2} - a^{3} \tan \left (d x + c\right ) + 3 \, a b^{2} \tan \left (d x + c\right ) + 3 \, a^{2} b}{\tan \left (d x + c\right )^{2} + 1}}{2 \, d} \]
[In]
[Out]
Time = 23.26 (sec) , antiderivative size = 156, normalized size of antiderivative = 1.71 \[ \int \sec (c+d x) (a \cos (c+d x)+b \sin (c+d x))^3 \, dx=\frac {b^3\,\ln \left (\frac {1}{{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}\right )-b^3\,\ln \left (\frac {\cos \left (c+d\,x\right )}{\cos \left (c+d\,x\right )+1}\right )+a^3\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )+\frac {b^3\,\cos \left (2\,c+2\,d\,x\right )}{4}+\frac {a^3\,\sin \left (2\,c+2\,d\,x\right )}{4}+3\,a\,b^2\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )-\frac {3\,a^2\,b\,\cos \left (2\,c+2\,d\,x\right )}{4}-\frac {3\,a\,b^2\,\sin \left (2\,c+2\,d\,x\right )}{4}}{d} \]
[In]
[Out]